import request from '@/utils/request'
// 获取企业列表
export const getEnterpriseListApi = (params) => request({
  url: '/park/enterprise',
  params
})
// 获取行业列表
export const getIndustryListApi = () => request({
  url: '/park/industry'
})
// 上传合同
export const uploadApi = (data) => request({
  url: '/upload',
  method: 'POST',
  data
})
// 新增公司
export const createEnterpriseApi = (data) => request({
  url: '/park/enterprise',
  method: 'post',
  data
})
// 获取企业详情
export const getEnterpriseDetailApi = (id) => request({
  url: `/park/enterprise/${id}`
})
// 更新企业
export const updateEnterpriseApi = (data) => request({
  url: '/park/enterprise',
  method: 'PUT',
  data
})
// 删除企业
export const delEnterpriseApi = (id) => request({
  url: `/park/enterprise/${id}`,
  method: 'DELETE'
})
// 获取空置中的楼宇列表
export const getRentBuildListApi = () => request({
  url: '/park/rent/building'
})
// 给当前企业添加合同
export const createRentApi = (data) => request({
  url: '/park/enterprise/rent',
  method: 'POST',
  data
})
// 获取当前合同列表
export const getRentListApi = (id) => request({
  url: `/park/enterprise/rent/${id}`
})

// 退组
export const outRentApi = (rentId) => request({
  url: `/park/enterprise/rent/${rentId}`,
  method: 'PUT'
})
// // 下载合同文件
export const downloadContractApi = (id) => request(`/download/${id}`, {
  responseType: 'blob'
})
